package com.hfb.mashibing.alip8.jvm.c2_classloader;

/**
 * ClassLoader 的父子关系
 */
public class T004_ClassLoaderParentChild {

    public static void main(String[] args) {
        final String format = "%s classLoader is %s\n";
        final ClassLoader thisClassLoader = T004_ClassLoaderParentChild.class.getClassLoader();
        System.out.printf(format,"T004_ClassLoaderParentChild.class.getClassLoader()", thisClassLoader);
        System.out.printf(format,"T004_ClassLoaderParentChild.class.getClassLoader().getClass().getClassLoader()", thisClassLoader.getClass().getClassLoader());
        System.out.printf(format,"T004_ClassLoaderParentChild.class.getClassLoader().getParent()", thisClassLoader.getParent());
        System.out.printf(format,"T004_ClassLoaderParentChild.class.getClassLoader().getParent().getParent()", thisClassLoader.getParent().getParent());
        System.out.printf(format,"T004_ClassLoaderParentChild.class.getClassLoader().getParent().getParent().getParent()", thisClassLoader.getParent().getParent().getParent());

        System.out.println();
    }
}
